<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title th:text="${session.title}">123</title>
    <link th:replace="common/header" />
    <link rel="stylesheet" th:href="@{/css/ace-skins.min.css}" />
    <link th:replace="common/tip" />
    <script language="javascript" type="text/javascript" th:src="@{/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<body class="navbar-fixed">
<div th:replace="common/top"></div>
<div class="container-fluid main_bg" id="main-container">
    <a id="menu-toggler" href="#"><span></span></a>
    <div th:replace="common/menu"></div>
    <div id="main-content" class="clearfix">
        <div id="page-content" class="clearfix">
            <div th:replace="common/title"></div>
            <h3 class="header smaller lighter blue"><em class="icon-list"></em>定时任务管理</h3>

            <h4 class="header smaller lighter blue"><em class="icon-list"></em>任务管理</h4>
            <div class="row-fluid">
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(1);"><em class="icon-search"></em>处理每日任务</button>
                </div>
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(2);"><em class="icon-search"></em>处理历史任务</button>
                </div>
            </div>
            <h4 class="header smaller lighter blue"><em class="icon-list"></em>赛季管理</h4>
            <div class="row-fluid">
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(3);"><em class="icon-search"></em>处理第一天数据</button>
                </div>
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(4);"><em class="icon-search"></em>处理第21天数据</button>
                </div>
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(5);"><em class="icon-search"></em>处理第23天数据</button>
                </div>
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(6);"><em class="icon-search"></em>处理第25天数据</button>
                </div>
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(7);"><em class="icon-search"></em>处理第27天数据</button>
                </div>
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(8);"><em class="icon-search"></em>处理第28天数据</button>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(9);"><em class="icon-search"></em>处理最后一天数据</button>
                </div>
            </div>
            <h4 class="header smaller lighter blue"><em class="icon-list"></em>用户管理</h4>
            <div class="row-fluid">
                <div class="span2">
                    <button class="btn btn-info" style="float: right;" type="button" onclick="processTask(10);"><em class="icon-search"></em>清理未登录用户</button>
                </div>
            </div>


        </div>
        <div th:replace="common/skin :: skin"></div>
    </div>
    <!--/#main-content-->
</div>
<!--/.fluid-container#main-container-->
<div th:replace="common/jsList"></div>
<script>
    function processTask(type) {
        $.ajax({
            type: "POST",
            dataType: "text",
            url: "/task/processTask",
            data: "type=" + type,
            success: function(data){
                if(data === 'ok'){
                    showTip('tip','处理完成',4000);
                }else{
                    showTip('tip','无法处理定时任务',4000);
                }
            }
        });
    }
</script>
</body>
</html>